/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package filer;

/**
 *
 * @author maggie
 */
public abstract class UrlShortcut {

	protected String url;
	protected String title;
	protected long lastModified;

	public UrlShortcut() {
	}

	public static String getExtention(String fileName) {
		if (fileName == null) {
			return null;
		}
		int point = fileName.lastIndexOf(".");
		if (point != -1) {
			return fileName.substring(point + 1);
		}
		return fileName;
	}

	public static String getNameWithoutExtension(String filename) {
		int lastDotPos = filename.lastIndexOf('.');
		if (lastDotPos == -1) {
			return filename;
		} else if (lastDotPos == 0) {
			return filename;
		} else {
			return filename.substring(0, lastDotPos);
		}
	}

	public String getTitle() {
		return this.title;
	}

	public String getUrl() {
		return this.url;
	}

	public long lastModefied() {
		return this.lastModefied();
	}

}
